<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<div class="content-table-breadcrumb"><a href="/bk/level1"><返回</a></div>
<div class="form-edit-task">

<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<?php endif;?>

<form action="/bk/level1-edit-submit" method="post" name="form1" enctype="multipart/form-data" onsubmit="return submitform(this)">
<span>渠道：</span> <select name="channel_id" id="channel_id">
	<option value="">[选择]</option>
	<?php if($this->channels):?>
	<?php foreach($this->channels as $channel_id=>$channel_info):?>
		<option value="<?=$channel_id?>" <?php if($channel_id==$this->info['channel_id']){echo "selected='selected'";}?>><?=$channel_info['channel_name']?></option>
	<?php endforeach;?>
	<?php endif;?>
</select>  <font>*</font><br/>
<span>标题：</span><input type="text" placeholder="标题" name="title" id="title" value="<?=$this->info['title']?>">  <font>*</font><br/>
<span>发起人：</span><input type="text" placeholder="发起人" name="memo1" id="memo1" value="<?=$this->info['memo1']?>">  <font>*</font><br/>
<span>参与人数：</span><input type="text" placeholder="参与人数" name="joined_members" id="joined_members" value="<?=$this->info['joined_members']?>">  <font>*</font><br/>
<span>状态：</span> <select name="status" id="status">
	<option value="1" <?php if(1==$this->info['status']){echo "selected='selected'";}?>>在线</option>
	<option value="0" <?php if(0==$this->info['status']){echo "selected='selected'";}?>>下线</option>
</select>
 <font>*</font><br/>
<span>封面图：</span><input type="file" name="image" />&nbsp;&nbsp;(84x84)<br/>
<?php if($this->info['image_url']):?>
<a href="/images/banners/<?=$this->info['image_url']?>" target="_blank"><img src="/images/banners/<?=$this->info['image_url']?>" border="0" height="30" /></a>&nbsp;&nbsp;<a href="/bk/level1-image-del/id/<?=$this->info['id']?>">删除</a><br /><br />
<?php endif;?>
<br/>
<?php $n=1;?>
<?php foreach ($this->banners as $bid=>$bval):?>
<span>Banner<?=$n?>：</span><input type="file" name="ebanner_<?=$bid?>" />&nbsp;&nbsp;(720x274)&nbsp;&nbsp;链接<?=$n?>：<input type="text" name="eurl_<?=$bid?>" value="<?=$bval['target_url']?>" /><br/>
<?php if($bval['image_url']):?>
<a href="/images/banners/<?=$bval['image_url']?>" target="_blank"><img src="/images/banners/<?=$bval['image_url']?>" border="0" height="30" /></a>&nbsp;&nbsp;<a href="/bk/level1-banner-del/id/<?=$bid?>">删除</a><br /><br />
<?php endif;?>
<?php $n += 1;?>
<?php endforeach;?>
<?php if(8 > $n):?>
<?php for($k=$n;$k<=8;$k++):?>
<span>Banner<?=$k?>：</span><input type="file" name="nbanner_<?=$k?>" />&nbsp;&nbsp;(720x274)&nbsp;&nbsp;链接<?=$n?>：<input type="text" name="nurl_<?=$k?>" /><br/>
<?php endfor;?>
<?php endif;?>
<input type="hidden" name="id" value="<?=$this->info['id']?>" />
<input type="submit" class="buttonlong" value="确认" />
<br /><br />
</form>
</div>
<br/><br/>
</div>

<script>
function submitform() 
{
	if( document.form1.title.value.length == 0 )
	{
		alert("标题不能为空。");
		return false;
	}else if( document.form1.channel_id.value.length == 0 )
	{
		alert("渠道不能为空。");
		return false;
	}
	
	form1.submit();
}
</script>